home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / clean / sun3.lha / Sun3 / deltaS.dcl < prev    next >
Text File  |  1992-08-07  |  1KB  |  34 lines

  1. SYSTEM MODULE deltaS;
  2.  
  3. ==    Version 0.8
  4.  
  5. ==
  6. ==    String operations
  7. ==
  8.  
  9. RULE
  10.  
  11. ::    +S    !STRING    !STRING    ->    STRING;            ==    concatenate arg2 to arg1
  12. ::    =S    !STRING    !STRING    ->    BOOL;            ==    true if arg1 equals arg2
  13. ::    <>S    !STRING    !STRING    ->    BOOL;            ==    true if arg1 does not equal arg2
  14. ::    <S    !STRING    !STRING    ->    BOOL;            ==    true if arg1 is less then arg2
  15. ::    >S    !STRING    !STRING    ->    BOOL;            ==    true if arg1 is more then arg2
  16. ::    <=S    !STRING    !STRING    ->    BOOL;            ==    true if arg1 is less or equal to arg2
  17. ::    >=S    !STRING    !STRING    ->    BOOL;            ==    true if arg1 is more or equal to arg2
  18.  
  19. ::    INDEX    !STRING !INT        ->    CHAR;    ==    get the arg2th char from arg1
  20. ::    SLICE    !STRING !INT !INT    ->    STRING;    ==    get substr arg2 .. (arg3 - 1) from arg1
  21. ::    UPDATE    !STRING !CHAR !INT    ->    STRING;    ==     replace arg3th char in arg1 with arg2
  22. ::    LENGTH    !STRING                ->     INT;    ==    number of characters in string
  23.  
  24. <<
  25. String comparison is based on lexical order.
  26. String indices, as used in INDEX, SLICE and UPDATE, range from 0. SLICE s a b
  27. returns a string including the characters on position a and b. For illegal values
  28. of a and b an error message is given (and the program is aborted!).
  29. Notice that LENGTH gives the number of characters in the string and not the
  30. index of the last character.
  31. >>
  32.  
  33.  
  34.